package com.hongkl.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;
import javax.xml.crypto.Data;
import java.sql.SQLException;

@RestController
public class DataSourceController {

    @Autowired
    private DataSource dataSource;

    /***
     * 获取数据库的连接信息
     */
    @RequestMapping("/datasource")
    public void getDataSourceConnection() throws SQLException {


        System.out.println(dataSource.getConnection());
        System.out.println("datasource is ok");
    }



}
